<template>
  <div>
    <div ref="getMsg" @click="handleClick">我爱你爸爸</div>
    <button @click="getClassTodo">点击获取构造函数的方法</button>
    <p v-if="info.length">{{info}}</p>
  </div>
</template>

<script>
import {person} from 'assets/utils/class'
export default {
  name:'getDom',
    data(){
      return {
          info:''
      }
    },
    methods:{
        handleClick(){
            //获取原生dom节点信息
            this.$refs.getMsg.style.background='red';
            this.$refs.getMsg.innerHTML="我也爱你，孩子"
        },
        getClassTodo(){
            this.info=person.todo()
        }
    }
}
</script>
